{include file="public/head"}
<div class="main">
    {include file="public/left"}
    <div class="middle">
    {include file="public/header"}
    <div class='airtical_detail'>
        <div class="artical_content">
            <h2 id='title' class='title'></h2>
            <span id="artical_public" class='artical_public'>{:__('发表于')}：<span id="create_time"></span> {:__('浏览')}<span id="browse_num"></span>{:__('次')}</span>
            <div class='content' id="content"></div>
            <ul class='others'>
                <dl id="prev">{:__('上一篇')}：</dl>
                <dl id="next">{:__('下一篇')}：</dl>
            </ul>
        </div>
        {include file="public/articalright"}
    </div>
    {include file="public/foot"}
    </div>
    {include file="public/right"}
</div>
{include file="public/footer"}
<script>
    if("{$code}" != 1){
        layer.msg("{$msg}",{icon:3},function(){
            window.location.href="/index/Index/index";
        });
    }
    
    $.ajax({
        url:'/api/info/detail',
        type:'get',
        data:{id:"{$id}"},
        success:function(ret){
            if(ret['code'] == 1){
                if(ret['data'] == '' || ret['data'] == null || ret['data'] == undefined){
                    return false;
                }
                if(ret['data']['title'] != '' && ret['data']['title'] != null && ret['data']['title'] != undefined){
                    $("#title").html(ret['data']['title']);
                }
                if(ret['data']['create_time'] != '' && ret['data']['create_time'] != null && ret['data']['create_time'] != undefined){
                    $("#create_time").html(ret['data']['create_time']);
                }
                if(ret['data']['browse_num'] != '' && ret['data']['browse_num'] != null && ret['data']['browse_num'] != undefined){
                    $("#browse_num").html(ret['data']['browse_num']);
                }
                if(ret['data']['content'] != '' && ret['data']['content'] != null && ret['data']['content'] != undefined){
                    $("#content").append(ret['data']['content']);
                }
                if(ret['data']['prev'] != '' && ret['data']['prev'] != null && ret['data']['prev'] != undefined){
                    $("#prev").append("<a href='/"+ret['data']['prev']['route']+"'>"+ret['data']['prev']['title']+"</a>");
                } else{
                    $("#prev").remove();
                }
                if(ret['data']['next'] != '' && ret['data']['next'] != null && ret['data']['next'] != undefined){
                    $("#next").append("<a href='/"+ret['data']['next']['route']+"'>"+ret['data']['next']['title']+"</a>");
                } else {
                    $("#next").remove();
                }
            } else if(ret['code'] != 401){
                layer.msg(ret['msg'],{icon:2});
            }
        }
    });
</script>